<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Validates a document based on a schema</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domdocument.schemavalidate.html">DOMDocument::schemaValidate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="domdocument.validate.html">DOMDocument::validate</a></div>
 <div class="up"><a href="class.domdocument.html">DOMDocument</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="domdocument.schemavalidatesource" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMDocument::schemaValidateSource</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">DOMDocument::schemaValidateSource</span> &mdash; <span class="dc-title">
   Validates a document based on a schema
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-domdocument.schemavalidatesource-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>DOMDocument::schemaValidateSource</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$source</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   Validates a document based on a schema defined in the given string.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-domdocument.schemavalidatesource-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">source</code></em></dt>

     <dd>

      <p class="para">
       A string containing the schema.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">flags</code></em></dt>

     <dd>

      <p class="para">
       A bitmask of Libxml schema validation flags. Currently the only supported value is <a href="libxml.constants.html" class="link">LIBXML_SCHEMA_CREATE</a>. Available since PHP 5.5.2 and Libxml 2.6.14.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-domdocument.schemavalidatesource-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>

 <div class="refsect1 changelog" id="refsect1-domdocument.schemavalidatesource-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.5.2</td>
       <td>
        Added the <em><code class="parameter">flags</code></em> parameter
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-domdocument.schemavalidatesource-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="domdocument.schemavalidate.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::schemaValidate()</a> - Validates a document based on a schema</span></li>
    <li class="member"><span class="methodname"><a href="domdocument.relaxngvalidate.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::relaxNGValidate()</a> - Performs relaxNG validation on the document</span></li>
    <li class="member"><span class="methodname"><a href="domdocument.relaxngvalidatesource.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::relaxNGValidateSource()</a> - Performs relaxNG validation on the document</span></li>
    <li class="member"><span class="methodname"><a href="domdocument.validate.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::validate()</a> - Validates the document based on its DTD</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domdocument.schemavalidate.html">DOMDocument::schemaValidate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="domdocument.validate.html">DOMDocument::validate</a></div>
 <div class="up"><a href="class.domdocument.html">DOMDocument</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
